package designModel.singleInstance;

public class Singleton_03 {
    private static Singleton_03 instance;

    private Singleton_03() {
    }

    public static Singleton_03 getInstance() {
        if (instance == null) {
            synchronized (Singleton_03.class) {
                if (instance == null) {
                    instance = new Singleton_03();
                }
            }
        }
        return instance;
    }

    public void doSomething() {
        System.out.println(getClass().getSimpleName() + ":带有双重校验的同步锁单例");
    }
}
